home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / hypercrd / xcmds / shwdlg16.hqx / ShowDialog XCMD 1.6 / card_9208.txt < prev    next >
Text File  |  1989-05-10  |  11KB  |  344 lines

  1. -- card: 9208 from stack: in.6
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 3411
  5. -- name: Auxiliary X-Commands
  6. ----- HyperTalk script -----
  7. on turnOn buttonNo
  8.   lock screen
  9.   hide cd fld "Info"
  10.   hide bg fld "theResult"
  11.   repeat with counter = 1 to 4
  12.     if buttonNo = counter then
  13.       set the hilite of cd btn counter to TRUE
  14.       show bg fld counter
  15.     else
  16.       set the hilite of cd btn counter to FALSE
  17.       hide bg fld counter
  18.     end if
  19.   end repeat
  20.   set scroll of bg fld buttonNo to 0
  21.   show bg btn "Close Information"
  22.   unlock screen with visual effect dissolve
  23. end turnOn
  24.  
  25. on closeall
  26.   set cursor to watch
  27.   lock screen
  28.   repeat with x = 1 to 4
  29.     hide bg fld x
  30.     set hilite of cd btn x to FALSE
  31.   end repeat
  32.   hide bg btn "Close Information"
  33.   show cd fld "info"
  34.   show bg fld "theResult"
  35.   unlock screen with visual effect dissolve
  36. end closeall
  37.  
  38. on closecard
  39.   closeall
  40. end closecard
  41.  
  42. on printIt
  43.   put bg fld 1 & return & bg fld 2 & return & bg fld 3 & return & bg fld 4 into container
  44.   put bg fld "Title" into prompt
  45.   PrintDoc prompt,container,prompt,times,12
  46. end printIt
  47.  
  48.  
  49.  
  50. -- part 2 (button)
  51. -- low flags: 00
  52. -- high flags: A004
  53. -- rect: left=17 top=90 right=112 bottom=194
  54. -- title width / last selected line: 0
  55. -- icon id / first selected line: 0 / 0
  56. -- text alignment: 1
  57. -- font id: 0
  58. -- text size: 12
  59. -- style flags: 0
  60. -- line height: 16
  61. -- part name: PrintDoc XCMD
  62. ----- HyperTalk script -----
  63. on mouseUp
  64.   if the visible of bg fld (the number of me) then
  65.     closeall
  66.   else
  67.     put the number of me into displayinfo
  68.     turnOn displayinfo
  69.   end if
  70. end mouseUp
  71.  
  72.  
  73.  
  74. -- part 3 (button)
  75. -- low flags: 00
  76. -- high flags: A004
  77. -- rect: left=17 top=120 right=142 bottom=194
  78. -- title width / last selected line: 0
  79. -- icon id / first selected line: 0 / 0
  80. -- text alignment: 1
  81. -- font id: 0
  82. -- text size: 12
  83. -- style flags: 0
  84. -- line height: 16
  85. -- part name: ClipToPICT XFCN
  86. ----- HyperTalk script -----
  87. on mouseUp
  88.   if the visible of bg fld (the number of me) then
  89.     closeall
  90.   else
  91.     put the number of me into displayinfo
  92.     turnOn displayinfo
  93.   end if
  94. end mouseUp
  95.  
  96.  
  97.  
  98. -- part 4 (button)
  99. -- low flags: 00
  100. -- high flags: A004
  101. -- rect: left=17 top=150 right=172 bottom=194
  102. -- title width / last selected line: 0
  103. -- icon id / first selected line: 0 / 0
  104. -- text alignment: 1
  105. -- font id: 0
  106. -- text size: 12
  107. -- style flags: 0
  108. -- line height: 16
  109. -- part name: Ants XFCN
  110. ----- HyperTalk script -----
  111. on mouseUp
  112.   if the visible of bg fld (the number of me) then
  113.     closeall
  114.   else
  115.     put the number of me into displayinfo
  116.     turnOn displayinfo
  117.   end if
  118. end mouseUp
  119.  
  120.  
  121.  
  122. -- part 5 (button)
  123. -- low flags: 00
  124. -- high flags: A004
  125. -- rect: left=17 top=180 right=202 bottom=194
  126. -- title width / last selected line: 0
  127. -- icon id / first selected line: 0 / 0
  128. -- text alignment: 1
  129. -- font id: 0
  130. -- text size: 12
  131. -- style flags: 0
  132. -- line height: 16
  133. -- part name: ColorOn XFCN
  134. ----- HyperTalk script -----
  135. on mouseUp
  136.   if the visible of bg fld (the number of me) then
  137.     closeall
  138.   else
  139.     put the number of me into displayinfo
  140.     turnOn displayinfo
  141.   end if
  142. end mouseUp
  143.  
  144.  
  145.  
  146. -- part 6 (field)
  147. -- low flags: 01
  148. -- high flags: 2000
  149. -- rect: left=124 top=50 right=83 bottom=391
  150. -- title width / last selected line: 0
  151. -- icon id / first selected line: 0 / 0
  152. -- text alignment: 0
  153. -- font id: 3
  154. -- text size: 10
  155. -- style flags: 0
  156. -- line height: 13
  157. -- part name: Info
  158.  
  159.  
  160. -- part 7 (button)
  161. -- low flags: 00
  162. -- high flags: 0000
  163. -- rect: left=11 top=4 right=64 bottom=78
  164. -- title width / last selected line: 0
  165. -- icon id / first selected line: 529 / 529
  166. -- text alignment: 1
  167. -- font id: 0
  168. -- text size: 12
  169. -- style flags: 0
  170. -- line height: 16
  171. -- part name: SD
  172.  
  173.  
  174. -- part contents for background part 21
  175. ----- text -----
  176. Auxiliary X-Commands
  177.  
  178. -- part contents for background part 31
  179. ----- text -----
  180. ColorOn XFCN  1.0
  181. ┬⌐Copyright 1988 by Jay Hodgdon
  182.  
  183. on mouseUp
  184.      put ColorOn() into theMode
  185.      if theMode is TRUE then
  186.           doColorThing
  187.      else doBWThing
  188. end mouseUp
  189.  
  190. ColorOn XFCN returns TRUE if the monitor is currently in color mode and FALSE if it is in monochrome.
  191.  
  192. It first checks to see if color QuickDraw is supported.  If color QuickDraw is present, it then quizzes the graphics device for its color/monochrome setting.
  193.  
  194. If you use this XFCN on a Macintosh containing a non-standard color graphics device (such as the Mac SE Orchard card) it will still return a value of FALSE because true color QuickDraw is not being used.
  195.  
  196. If you use this XFCN in a multiple screen environment it will return TRUE if ANY of the graphics devices is displaying color.
  197.  
  198. See the script of the "Who did this?" button on card 1 for a demo of this XFCN.
  199. ΓÇó Click┬áhere┬áto┬ágo┬áthere┬ánow. ΓÇó
  200.  
  201.  
  202.  
  203. -- part contents for background part 15
  204. ----- text -----
  205. PrintDoc XCMD 1.03
  206. ┬⌐Copyright 1988,1989 by Jay Hodgdon
  207.  
  208. PrintDoc XCMD prints the contents of a field or variable (up to 32K) in your choice of font and size.  Pages will be numbered and contain a centered header at the top.  A print-cancel box is presented, allowing the user to cancel the print job.
  209.  
  210. The parameters of PrintDoc XCMD are:
  211.  
  212. PrintDoc <header>,<container>,<variable>,<font>,<size>
  213.  
  214. where
  215. <header> is a string that will appear at the top of each printed page;
  216. <container> is a field or variable that contains what will be printed;
  217. <variable> is a string that will appear in the "print cancel" dialog and in the long narrow LaserWriter status dialog;
  218. <font> is the font that <container> will be printed in;
  219. <size> is the font size.
  220.  
  221. If the specified font is missing, Geneva will be substituted.
  222. The header that is printed on each page will be in Times 12.  It will be centered on the page.
  223. Each page will be numbered (at the bottom center) in Times 12.
  224.  
  225. The print set-up (not the PAGE set-up) dialog will be presented.  If the user clicks Cancel the result returned by the XCMD will be "Print job canceled."  If the user clicks OK a  dialog will appear that will contain <variable> in the string "Printing <variable>" and  "Type command-. to Cancel."  The first string will ALWAYS be centered within the dialog, regardless of the length of <variable> (unless it overruns the width of the box).  This dialog will be centered on the screen (NOT on the card window), just below where the laserwriter status dialog is displayed.
  226.  
  227. If the user types Command-period during printing, the print job will be cancelled and the cancel dialog will be dismissed.  The result will be empty.
  228.  
  229. If the print job is successful the result will be empty.
  230. Error codes returned in the result are:
  231. Error:  There is nothing to print!
  232. Error:  Can only print 32000 characters at a time!
  233.  
  234. If you don't wish to have the cancel dialog displayed, omit the DLOG/DITL resources (ID 5100) from your stack.  I recommend that you use it. (You cannot renumber these resources.)
  235.  
  236. Revision history:
  237. Version 1.03  4/2/89
  238. has better error handling for situations where the LaserWriter is turned off when trying to print or when the "printing" files are missing from the System Folder.  It also fixes a gross bug where the XCMD would crash the machine if the printing DLOG/DITLs were missing from the stack.
  239.  
  240.  
  241.  
  242. -- part contents for background part 17
  243. ----- text -----
  244. ClipToPICT XFCN 1.2
  245. ┬⌐Copyright 1988,1989 by Jay Hodgdon
  246.  
  247. ClipToPICT XFCN converts whatever picture is on the clipboard into a PICT resource and places it in the current stack, any other stack, or into a new file (that is "double-clickable" by ResEdit).
  248.  
  249. The parameters of ClipToPICT XFCN are:
  250. ClipToPICT(<new PICT resource ID>,<new PICT name>,
  251. <where>)
  252.  
  253. where:
  254. <new PICT resource ID>  is the resource ID number for the new PICT;
  255.  
  256. <new PICT name> is the name of the new PICT resource;
  257.  
  258. <where> specifies if the PICT is to be inserted into the current stack, any other stack, or into a new file.  This parameter must be "this", "other", or "file".
  259.  
  260. If the <where> parameter is:
  261.  
  262. "this" then the PICT is inserted into the current stack.
  263.  
  264. "other" then the PICT is inserted into another stack.  The standard file box is displayed for selection of the stack.
  265.  
  266. "file" then the standard file box is displayed allowing you to create a new file that will contain the PICT resource.  This file is "double-clickable" by ResEdit.
  267.  
  268. If you pass "0" (that's a zero) as the first parameter, ClipToPICT will assign its own unique ID to the new resource.
  269.  
  270. If you leave the second parameter empty (that doesn't mean that you can OMIT the second parameter) then the new PICT will be unnamed.
  271.  
  272. If everything goes alright, the ID of the new PICT resource will be returned by the function.  If something goes wrong the following errors are returned:
  273.  
  274. Form:  ClipToPICT(<PICT ID>,<PICT name>,<where>)
  275. Error:  That PICT resource ID already exists!
  276. Error:  That PICT name already exists!
  277. Error:  There isn't a picture on the clipboard!
  278. Error:  Unable to open the stack!
  279.  
  280. Any disk related errors will be reported by:
  281. Error:  Resource not found
  282. Error:  Resource file not found
  283. Error:  ClipToPICT failed to add resource
  284. Error:  RmveResource failed
  285. Error:  Attribute does not permit operation
  286. Error:  Map does not permit operation
  287. Error:  Disk is full
  288. Error:  Disk is locked
  289. Error:  File is locked
  290.  
  291. or other nonspecific errors in the form:
  292. Error:  <OSError>
  293. where <OSError> is one of the standard Macintosh operating system error codes.  
  294.  
  295. As you can deduce from the error messages, ClipToPICT will not write over a previously existing PICT resource if it has the same ID or name as the new one.  If there isn't anything on the clipboard (or there is text), ClipToPICT will exit (with a beep) without creating a resource.
  296.  
  297. See the script of PICT Maker for a demo of the XCMD.
  298. ΓÇó Click┬áhere┬áto┬ágo┬áthere┬ánow. ΓÇó
  299.  
  300. Revision history:
  301. 1.0  
  302. initial release
  303. 1.11      12/22/88
  304. The newly created PICT resource is made purgeable.
  305. 1.2        5/5/89
  306. Rewrote ClipToPICT so that it can insert a newly created PICT into any other stack, or a new file, in addition to the current stack.
  307.  
  308.  
  309.  
  310. -- part contents for background part 18
  311. ----- text -----
  312. Ants XFCN 1.2
  313. ┬⌐Copyright 1988,1989 by Jay Hodgdon
  314.  
  315. Ants XFCN returns the coordinates of a rectangle drawn out with the mouse.  When Ants is "active" it changes the cursor into the cross-hair.  Then when the user clicks the mouse, a marquee-style rectangle will be drawn out on the screen.
  316.  
  317. on mouseUp
  318.      put Ants() into theRect
  319. end mouseUp
  320.  
  321. Ants XFCN produces one error message:
  322. Error:  Not enough momory to make bitmap.
  323. It will beep if this happens.
  324.  
  325. See the script of PICT Maker for a demo of this XFCN.
  326. ΓÇó Click┬áhere┬áto┬ágo┬áthere┬ánow. ΓÇó
  327.  
  328. Revision history:
  329. 1.0        11/13/88
  330. Ants draws a rectangle on the screen, but don't march!
  331. 1.1        12/17/88
  332. Made the Ants march.
  333. 1.2        5/10/89  
  334. Converted Ants to an offscreen bitmap and used CopyBits to eliminate screen flicker when drawing the rectangle.  Ants now also forces the event queue to be flushed so that the mouseclick that draws out the rectangle isn't passed along to HyperCard.
  335.  
  336.  
  337.  
  338. -- part contents for background part 30
  339. ----- text -----
  340. 22
  341.  
  342. -- part contents for card part 6
  343. ----- text -----
  344. These X-commands were used in the preparation of this stack, and are part of the ShowDialog "package."